package com.zitangkou.user.security;

import com.zitangkou.common.global.UserContent;
import lombok.Getter;
import lombok.Setter;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.User;

import java.util.Collection;

/**
 * @author Deng Ningning
 * @date 2020/9/9 23:29
 */
public class MyUserDetails extends User {

    /**
     * 用户详情
     */
    @Getter
    @Setter
    UserContent userContent;

    public MyUserDetails(String username, String password,
                         Collection<? extends GrantedAuthority> authorities, UserContent userContent) {
        super(username, password, authorities);
        this.userContent = userContent;
    }

    @Override
    public boolean isAccountNonLocked() {
        return true;
    }

    @Override
    public boolean equals(Object rhs) {
        return super.equals(rhs);
    }

    @Override
    public int hashCode() {
        return super.hashCode();
    }
}
